package 设计模式.行为模式.模板模式;

/**
 * @author lchenglong
 * @date 2024/1/26
 */
public enum LoginTypeEnum {

    SMS(2,"验证码"),
    PASSWORD(1,"验证码"),
    GESTURE(3,"验证码");

    private Integer type;
    private String value;

    LoginTypeEnum(Integer type, String value) {
        this.type = type;
        this.value = value;
    }

    public static LoginTypeEnum getEnumByType(Integer type){
        for (LoginTypeEnum loginTypeEnum:values()){
            if (loginTypeEnum.type.equals(type)){
                return  loginTypeEnum;
            }
        }
        return null;
    }
}
